'''
Created on Jul 7, 2009

@author: morales
'''

from easygui import *
import sys

msg = "Enter parameters below"
title = "Polyspect optimizer for CC model"
fieldNames = ["N(0) - Present effective size", \
			"N(t) - New population size", \
			"t - Time of pop. change (coalescent time)", \
			"S - Segregating sites", \
			"n - Number of Chromosomes", \
			"Number of simulations"]
defaultValues = ["10000", \
			"100", \
			"0.25", \
			"50", \
			"30", \
			"1000"]  # we start with blanks for the values
fieldValues = multenterbox(msg,title, fieldNames, defaultValues)

# make sure that none of the fields was left blank
while 1:
	if fieldValues == None: break
	errmsg = ""
	for i in range(len(fieldNames)):
		if fieldValues[i].strip() == "":
			errmsg = errmsg + ('"%s" is a required field.\n\n' % fieldNames[i])
	if errmsg == "": break # no problems found
	fieldValues = multenterbox(errmsg, title, fieldNames, fieldValues)

print "Reply was:", fieldValues
